﻿
@{
    ViewBag.Title = "Datetime Picker";
    Layout = "~/Areas/Demo/Views/Shared/Demo_Layout.cshtml";
}

<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">Upload</h1>
    </div>
</div>

<div class="row">
    <div class="col-lg-6">
        <div class="panel panel-default">
            <div class="panel-heading">
                datetimepicker
            </div>
            <div class="panel-body">
                <a href="http://www.bootcss.com/p/bootstrap-datetimepicker/" target="_blank">中文API</a>
                <link href="~/bower_components/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
                <div class="form-group ">
                    <div id="DateTimePicker" class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd hh:ii:ss" data-link-field="LinkTime" data-link-format="yyyy-mm-dd hh:ii:ss">
                        <input class="form-control" type="text" value="" readonly>
                        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                    </div>
                </div>
                <div class="form-group ">
                    <input type="text" id="LinkTime" class="form-control" value="" />
                </div>
                <script src="~/bower_components/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
                <script src="~/bower_components/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
                <script type="text/javascript">
                        $(function () {
                            $('#DateTimePicker').datetimepicker({
                                language: 'zh-CN',
                                weekStart: 1,
                                todayBtn: 1,
                                autoclose: 1,
                                todayHighlight: 1,
                                startView: 2,
                                minView: 2,
                                forceParse: 0,
                                startDate: '2017-01-10',
                                endDate: '2017-01-20',
                            });
                            $('#DateTimePicker input[type="text"]').val('@(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"))');
                            $('#DateTimePicker').datetimepicker('update');
                        });
                </script>
            </div>
        </div>
    </div>
</div>
